// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package edu.uoc.tfc.dbmodel;
/**
 * @see edu.uoc.tfc.dbmodel.Client
 */
public class ClientDaoImpl
    extends edu.uoc.tfc.dbmodel.ClientDaoBase
{
    /**
     * @see edu.uoc.tfc.dbmodel.ClientDao#toClientVO(edu.uoc.tfc.dbmodel.Client, edu.uoc.tfc.dto.ClientVO)
     */
    public void toClientVO(
        edu.uoc.tfc.dbmodel.Client source,
        edu.uoc.tfc.dto.ClientVO target)
    {
        // @todo verify behavior of toClientVO
        super.toClientVO(source, target);
        // WARNING! No conversion for target.partsDelClient (can't convert source.getPartsDelClient():edu.uoc.tfc.dbmodel.Part to edu.uoc.tfc.dto.PartVO
    }


    /**
     * @see edu.uoc.tfc.dbmodel.ClientDao#toClientVO(edu.uoc.tfc.dbmodel.Client)
     */
    public edu.uoc.tfc.dto.ClientVO toClientVO(final edu.uoc.tfc.dbmodel.Client entity)
    {
        // @todo verify behavior of toClientVO
        return super.toClientVO(entity);
    }


    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private edu.uoc.tfc.dbmodel.Client loadClientFromClientVO(edu.uoc.tfc.dto.ClientVO clientVO)
    {

        edu.uoc.tfc.dbmodel.Client client = this.load(Long.valueOf(clientVO.getId()));
        if (client == null)
        {
            client = edu.uoc.tfc.dbmodel.Client.Factory.newInstance();
        }
        return client;
    }

    
    /**
     * @see edu.uoc.tfc.dbmodel.ClientDao#clientVOToEntity(edu.uoc.tfc.dto.ClientVO)
     */
    public edu.uoc.tfc.dbmodel.Client clientVOToEntity(edu.uoc.tfc.dto.ClientVO clientVO)
    {
        // @todo verify behavior of clientVOToEntity
        edu.uoc.tfc.dbmodel.Client entity = this.loadClientFromClientVO(clientVO);
        this.clientVOToEntity(clientVO, entity, true);
        return entity;
    }


    /**
     * @see edu.uoc.tfc.dbmodel.ClientDao#clientVOToEntity(edu.uoc.tfc.dto.ClientVO, edu.uoc.tfc.dbmodel.Client)
     */
    public void clientVOToEntity(
        edu.uoc.tfc.dto.ClientVO source,
        edu.uoc.tfc.dbmodel.Client target,
        boolean copyIfNull)
    {
        // @todo verify behavior of clientVOToEntity
        super.clientVOToEntity(source, target, copyIfNull);
    }    

}